Optimal. Leaf size=117 \[ -\frac {3 a^2 \text {ArcTan}\left (\frac {\sqrt {c} \tan (e+f x)}{\sqrt {2} \sqrt {c-c \sec (e+f x)}}\right )}{4 \sqrt {2} c^{5/2} f}-\frac {a^2 \tan (e+f x)}{f (c-c \sec (e+f x))^{5/2}}+\frac {5 a^2 \tan (e+f x)}{4 c f (c-c \sec (e+f x))^{3/2}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.16, antiderivative size = 130, normalized size of antiderivative = 1.11, number of steps
used = 4, number of rules used = 3, integrand size = 34, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.088, Rules used = {4042, 3880,
209} \begin {gather*} -\frac {3 a^2 \text {ArcTan}\left (\frac {\sqrt {c} \tan (e+f x)}{\sqrt {2} \sqrt {c-c \sec (e+f x)}}\right )}{4 \sqrt {2} c^{5/2} f}+\frac {3 a^2 \tan (e+f x)}{4 c f (c-c \sec (e+f x))^{3/2}}-\frac {\tan (e+f x) \left (a^2 \sec (e+f x)+a^2\right )}{2 f (c-c \sec (e+f x))^{5/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 3880
Rule 4042
Rubi steps
\begin {align*} \int \frac {\sec (e+f x) (a+a \sec (e+f x))^2}{(c-c \sec (e+f x))^{5/2}} \, dx &=-\frac {\left (a^2+a^2 \sec (e+f x)\right ) \tan (e+f x)}{2 f (c-c \sec (e+f x))^{5/2}}-\frac {(3 a) \int \frac {\sec (e+f x) (a+a \sec (e+f x))}{(c-c \sec (e+f x))^{3/2}} \, dx}{4 c}\\ &=-\frac {\left (a^2+a^2 \sec (e+f x)\right ) \tan (e+f x)}{2 f (c-c \sec (e+f x))^{5/2}}+\frac {3 a^2 \tan (e+f x)}{4 c f (c-c \sec (e+f x))^{3/2}}+\frac {\left (3 a^2\right ) \int \frac {\sec (e+f x)}{\sqrt {c-c \sec (e+f x)}} \, dx}{8 c^2}\\ &=-\frac {\left (a^2+a^2 \sec (e+f x)\right ) \tan (e+f x)}{2 f (c-c \sec (e+f x))^{5/2}}+\frac {3 a^2 \tan (e+f x)}{4 c f (c-c \sec (e+f x))^{3/2}}-\frac {\left (3 a^2\right ) \text {Subst}\left (\int \frac {1}{2 c+x^2} \, dx,x,\frac {c \tan (e+f x)}{\sqrt {c-c \sec (e+f x)}}\right )}{4 c^2 f}\\ &=-\frac {3 a^2 \tan ^{-1}\left (\frac {\sqrt {c} \tan (e+f x)}{\sqrt {2} \sqrt {c-c \sec (e+f x)}}\right )}{4 \sqrt {2} c^{5/2} f}-\frac {\left (a^2+a^2 \sec (e+f x)\right ) \tan (e+f x)}{2 f (c-c \sec (e+f x))^{5/2}}+\frac {3 a^2 \tan (e+f x)}{4 c f (c-c \sec (e+f x))^{3/2}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 2.49, size = 359, normalized size = 3.07 \begin {gather*} -\frac {a^2 e^{-\frac {1}{2} i (e+f x)} \csc \left (\frac {e}{2}\right ) \sec ^3\left (\frac {1}{2} (e+f x)\right ) \sqrt {\sec (e+f x)} (1+\sec (e+f x))^2 \left (\frac {e^{-\frac {3 i e}{2}} \left (-1+e^{i e}\right ) \left (\cos \left (\frac {f x}{2}\right )+i \sin \left (\frac {f x}{2}\right )\right ) \left (-9 i e^{i e} \left (1+e^{i e}\right ) \cos \left (\frac {f x}{2}\right )+i \left (1+e^{3 i e}\right ) \cos \left (\frac {3 f x}{2}\right )-9 e^{i e} \sin \left (\frac {f x}{2}\right )+9 e^{2 i e} \sin \left (\frac {f x}{2}\right )+\sin \left (\frac {3 f x}{2}\right )-e^{3 i e} \sin \left (\frac {3 f x}{2}\right )\right )}{16 \sqrt {\sec (e+f x)}}+3 \sqrt {\frac {e^{i (e+f x)}}{1+e^{2 i (e+f x)}}} \sqrt {1+e^{2 i (e+f x)}} \tanh ^{-1}\left (\frac {1+e^{i (e+f x)}}{\sqrt {2} \sqrt {1+e^{2 i (e+f x)}}}\right ) \sin \left (\frac {e}{2}\right ) \sin ^4\left (\frac {1}{2} (e+f x)\right )\right ) \tan \left (\frac {1}{2} (e+f x)\right )}{4 c^2 f (-1+\sec (e+f x))^2 \sqrt {c-c \sec (e+f x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(229\) vs.
\(2(100)=200\).
time = 2.43, size = 230, normalized size = 1.97
method | result | size |
default | \(-\frac {a^{2} \left (-1+\cos \left (f x +e \right )\right )^{3} \left (\left (\cos ^{2}\left (f x +e \right )\right ) \sqrt {-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}+3 \left (\cos ^{2}\left (f x +e \right )\right ) \arctan \left (\frac {1}{\sqrt {-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}}\right )-4 \cos \left (f x +e \right ) \sqrt {-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}-6 \cos \left (f x +e \right ) \arctan \left (\frac {1}{\sqrt {-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}}\right )-5 \sqrt {-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}+3 \arctan \left (\frac {1}{\sqrt {-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}}\right )\right )}{f \left (\frac {c \left (-1+\cos \left (f x +e \right )\right )}{\cos \left (f x +e \right )}\right )^{\frac {5}{2}} \sin \left (f x +e \right )^{5} \left (-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}\right )^{\frac {5}{2}}}\) | \(230\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.24, size = 463, normalized size = 3.96 \begin {gather*} \left [-\frac {3 \, \sqrt {2} {\left (a^{2} \cos \left (f x + e\right )^{2} - 2 \, a^{2} \cos \left (f x + e\right ) + a^{2}\right )} \sqrt {-c} \log \left (\frac {2 \, \sqrt {2} {\left (\cos \left (f x + e\right )^{2} + \cos \left (f x + e\right )\right )} \sqrt {-c} \sqrt {\frac {c \cos \left (f x + e\right ) - c}{\cos \left (f x + e\right )}} + {\left (3 \, c \cos \left (f x + e\right ) + c\right )} \sin \left (f x + e\right )}{{\left (\cos \left (f x + e\right ) - 1\right )} \sin \left (f x + e\right )}\right ) \sin \left (f x + e\right ) + 4 \, {\left (a^{2} \cos \left (f x + e\right )^{3} - 4 \, a^{2} \cos \left (f x + e\right )^{2} - 5 \, a^{2} \cos \left (f x + e\right )\right )} \sqrt {\frac {c \cos \left (f x + e\right ) - c}{\cos \left (f x + e\right )}}}{16 \, {\left (c^{3} f \cos \left (f x + e\right )^{2} - 2 \, c^{3} f \cos \left (f x + e\right ) + c^{3} f\right )} \sin \left (f x + e\right )}, \frac {3 \, \sqrt {2} {\left (a^{2} \cos \left (f x + e\right )^{2} - 2 \, a^{2} \cos \left (f x + e\right ) + a^{2}\right )} \sqrt {c} \arctan \left (\frac {\sqrt {2} \sqrt {\frac {c \cos \left (f x + e\right ) - c}{\cos \left (f x + e\right )}} \cos \left (f x + e\right )}{\sqrt {c} \sin \left (f x + e\right )}\right ) \sin \left (f x + e\right ) - 2 \, {\left (a^{2} \cos \left (f x + e\right )^{3} - 4 \, a^{2} \cos \left (f x + e\right )^{2} - 5 \, a^{2} \cos \left (f x + e\right )\right )} \sqrt {\frac {c \cos \left (f x + e\right ) - c}{\cos \left (f x + e\right )}}}{8 \, {\left (c^{3} f \cos \left (f x + e\right )^{2} - 2 \, c^{3} f \cos \left (f x + e\right ) + c^{3} f\right )} \sin \left (f x + e\right )}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} a^{2} \left (\int \frac {\sec {\left (e + f x \right )}}{c^{2} \sqrt {- c \sec {\left (e + f x \right )} + c} \sec ^{2}{\left (e + f x \right )} - 2 c^{2} \sqrt {- c \sec {\left (e + f x \right )} + c} \sec {\left (e + f x \right )} + c^{2} \sqrt {- c \sec {\left (e + f x \right )} + c}}\, dx + \int \frac {2 \sec ^{2}{\left (e + f x \right )}}{c^{2} \sqrt {- c \sec {\left (e + f x \right )} + c} \sec ^{2}{\left (e + f x \right )} - 2 c^{2} \sqrt {- c \sec {\left (e + f x \right )} + c} \sec {\left (e + f x \right )} + c^{2} \sqrt {- c \sec {\left (e + f x \right )} + c}}\, dx + \int \frac {\sec ^{3}{\left (e + f x \right )}}{c^{2} \sqrt {- c \sec {\left (e + f x \right )} + c} \sec ^{2}{\left (e + f x \right )} - 2 c^{2} \sqrt {- c \sec {\left (e + f x \right )} + c} \sec {\left (e + f x \right )} + c^{2} \sqrt {- c \sec {\left (e + f x \right )} + c}}\, dx\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 1.39, size = 106, normalized size = 0.91 \begin {gather*} \frac {\sqrt {2} {\left (3 \, \sqrt {c} \arctan \left (\frac {\sqrt {c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - c}}{\sqrt {c}}\right ) + \frac {3 \, {\left (c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - c\right )}^{\frac {3}{2}} c + 5 \, \sqrt {c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - c} c^{2}}{c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4}}\right )} a^{2}}{8 \, c^{3} f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\left (a+\frac {a}{\cos \left (e+f\,x\right )}\right )}^2}{\cos \left (e+f\,x\right )\,{\left (c-\frac {c}{\cos \left (e+f\,x\right )}\right )}^{5/2}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________